//
//  MainNavControl.m
//  FreeTime
//
//  Created by  on 16/8/25.
//  Copyright © 2016年 SRDZ.com. All rights reserved.
//

#import "MainNavControl.h"
#import "Header.h"
@interface MainNavControl ()



@end

@implementation MainNavControl

- (void)viewDidLoad {
    
    [super viewDidLoad];
    
    self.automaticallyAdjustsScrollViewInsets = NO;
    
    [self.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],NSForegroundColorAttributeName,nil]];
    
    self.navigationBar.barTintColor = HOME_COLOR;
    
    self.navigationBar.translucent = NO;
    
    self.interactivePopGestureRecognizer.enabled = YES;
    
    self.interactivePopGestureRecognizer.delegate = nil;
    
    UIImageView * menuImage = [[UIImageView alloc] initWithFrame:CGRectMake(-7, 10, 20, 20)];
    menuImage.image = [UIImage imageNamed:@"back"];
    self.backButton = [UIButton buttonWithType:UIButtonTypeCustom];
    _backButton.frame = CGRectMake(0, 0, 50, 40);
    [_backButton addSubview:menuImage];
    [_backButton addTarget:self action:@selector(pop) forControlEvents:UIControlEventTouchUpInside];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:_backButton];
}
- (void)pop{
    
    [self popViewControllerAnimated:YES];
}
@end
